import { createElement } from "react";
import { Input, Select } from "antd";

import { RespDataType } from "../../api";

export const getFilterItems = (agentList: RespDataType.AgentSelectList) =>{
  return [
    {
      title: "公司名称",
      name: "name",
      gridSpan: 1,
      component: createElement(Input),
    },
    {
      title: "代理商",
      name: "agentId",
      gridSpan: 1,
      component: createElement(Select, {
        options: agentList,
        allowClear: true,
        showSearch: true,
        filterOption: (inputValue, option) => option.label.toLowerCase().includes(inputValue.toLowerCase()),
        style:{width: "100%"}
      }),
    },
  ];
}

export const filterItems = [
  {
    title: "公司名称",
    name: "name",
    gridSpan: 1,
    component: createElement(Input),
  },
];
